#include<stdio.h>
#include <stdlib.h>
int main()
{
    int a,b,c,d,e,x,y;
	printf("please input two numbers:\n");
    scanf("%d %d",&a,&b);
    x=a;
    y=b;
    if (a==0)
       printf ("%d 0\n",b);
    else if (b==0)
            printf  ("%d 0\n",a);
         else if (a==b)
			 printf  ("%d %d\n",a,b);
              else
			  {
				  do
				  {
					  if (a < b)
					  {
						  c=b;
						  b=a;
						  a=c;
					  }
					  d = a - b;
                      if (d == b)
					  {
						  printf ("%d ",d);
						  break;
					  }
                      a = b;
                      b = d;
				  }
                  while (d > 0);
				  e=y*x/d;
                  printf ("%d\n",e);
			  }
    return 0;
}
